package com.hyl.exam.service;
import com.example.exam.pojo.TestPaper;
import com.example.exam.pojo.User;
import com.hyl.exam.config.FeignConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Service
@Component
@FeignClient(value = "springcloud-provider-dept8002",configuration = FeignConfiguration.class)
public interface ClientService {

    /**
     *  查看题目
     */
    @GetMapping("/getQuestion")
    Object getQuestion();

    /**
     *  查看已经提交的答案
     */
    @GetMapping("/getTestPaper/{tid}")
    Object getTestPaper(@PathVariable(value = "tid") int tid);

    /**
     *  提交答案
     */
    @PostMapping("/submitTitle")
    Object submitTitle(@RequestBody TestPaper testPaper);

    /**
     *  预览答案
     */
    @GetMapping("/preview")
    Object preview(HttpServletRequest request);

    /**
     *  提交试卷
     */
    @PostMapping("/submit")
    Object submit(HttpServletRequest request) ;

    /**
     *  查看图片
     */
    @GetMapping("/getPicture/{pictureName}")
    void getPicture(@PathVariable(value = "pictureName") String pictureName);

    /**
     *  登录
     */
    @PostMapping("/login")
    Object login(@RequestBody User user);
}
